﻿using CommunityToolkit.Mvvm.ComponentModel;
using SqlSugar;
using System;

namespace ProductionLine.Modules.ShareLib.Models;
/// <summary>
/// 通用类
/// </summary>
public class EntityBase : ObservableObject {
    private int _id;
    /// <summary>
    /// Id:主键且自增
    /// </summary>
    [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
    public int Id {
        get => _id;
        /*
         https://learn.microsoft.com/zh-cn/dotnet/communitytoolkit/mvvm/observableobject
        https://blog.csdn.net/zkmrobot/article/details/147892631
         */
        set => SetProperty(ref _id, value);
    }


    private DateTime _createTime = DateTime.Now;
    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime {
        get => _createTime;
        set => SetProperty(ref _createTime, value);
    }


    private DateTime _updateTime = DateTime.Now;
    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime UpdateTime {
        get => _updateTime;
        set => SetProperty(ref _updateTime, value);
    }

}